package com.xiaohu.timing;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaohu.common.dao.User;
import com.xiaohu.common.mapper.TouristMapper;
import com.xiaohu.common.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ScheduledTasks {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private TouristMapper touristMapper;

    @Scheduled(cron = "0 0 0 * * ?") // 每天的24点执行一次
    public void doSomething() {
        touristMapper.touristTotalEmpty();
        userMapper.UserTotalEmpty();
    }
}
